<script>
	function setMcValue(node,data) {
		printLog(data);
	}
</script>
<table cellpadding="5">
	<input name="id" type="hidden" value="${(materialCategoryItem.id)!}" />
	<tr>
		<td class="tbLabel">父类别:</td>
		<td><script type="text/javascript">
			$(function() {
				$('#mcParent')
						.combotree(
								{
									url : 'materialCategory.do?materialCategoryTree&id=3',
									lines :true,
									checkbox:true,
// 									onlyLeafCheck:true,
									cascadeCheck : false,
									required : false,
									multiple : true,
									onChange : function(a, b) {
										$('#mcParenthidden').val(
												$('#mcParent').combotree(
														'getValues'));
									},
									onBeforeCheck:function(node,checked){
										 var t =$('#mcParent').combotree('tree');
										 var nodes =t.tree('getChecked');
										 for (var i = 0; i < nodes.length; i++) {
												if(nodes[i].id!=node.id) {
													 t.tree('uncheck',nodes[i].target);
												}
								         }
									},
// 									onCheck:function(node,checked){
// 										 var t =$('#mcParent').combotree('tree');// 得到树对象
// 										 var nodes =t.tree('getChecked');  // get checked nodes
// 										 if(nodes.length==2){
// 											 $.messager.show({
// 											 	title:'提示',
// 											  	msg:'只能选择一个对象',
// 											   	timeout:2000
// 											  });
// 										 	 t.tree('uncheck',node.target);//不选中当前的节点
// 										 }
// 									},
// 									onBeforeSelect:function(node){
// // 						                    alert(node.state);
// 						                    if(node.state){
// 						                        $("#mcParent").tree("unselect");
// 						                    }
// 						                    return false;
// 						            },
									onLoadSuccess : function(node, data) {
										setMcValue(node, data);
										$('#mcParent').combotree('setValues',
												[ 3 ]);
									},
								});
			});
		</script><input
			id="mcParent" name="parentMcId" style="width: 159px" /><input
			id="mcParenthidden" name="parentMcId" type="hidden" /></td>
	</tr>
	<tr>
		<td class="tbLabel">编码:</td>
		<td>
			<input name="code"  class="easyui-validatebox textbox" data-options="required: false" value="${(materialCategoryItem.code)!}"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">名称:</td>
		<td>
			<input name="name"  class="easyui-validatebox textbox" data-options="required: false" value="${(materialCategoryItem.name)!}"/>
		</td>
	</tr>
</table>
